package com.young.requestlimit.controller;

import com.young.requestlimit.annotation.RequestLimit;
import com.young.requestlimit.entity.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @PostMapping("/getUser")
    @RequestLimit
    public User getUser(@RequestBody User user) {
        return User.builder().age(23).name("张三").build();
    }
}
